import { WIN_MAIN_RENDERER_EVENT_NAME } from '@common/ipcNames';
import { mainHandle } from '@common/mainIpc';
import { getUserInfo, updatePassword } from '@main/core/sqlite/modules/userInfo';

export default () => {
  //用户登录接口
  mainHandle<any>(WIN_MAIN_RENDERER_EVENT_NAME.login, async (data: any) => {
    return await getUserInfo(data.params);
  });

  mainHandle<any>(WIN_MAIN_RENDERER_EVENT_NAME.updatePassword, async (data: any) => {
    return await updatePassword(data.params);
  });
};
